package com.glela.packet.mapper;

import com.glela.domain.vo.PerRedPacketVo;
import com.glela.packet.model.RedPacketOwner;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface RedPacketOwnerBizMapper {
  
  List<PerRedPacketVo> showRedPacketList(@Param("userId")Long userId, @Param("type")int type,@Param("nowDate") Date nowDate);
 	
  int batchInsert(List<RedPacketOwner> list);

  int batchUpdate(List<RedPacketOwner> list);

  RedPacketOwner getByRedPacketShareHistId(@Param(value = "redPacketShareHistId") int redPacketShareHistId);


  int queryRedPacketSize(@Param("userId")Long userId, @Param("type")int type,@Param("nowDate") Date nowDate);

  List<RedPacketOwner> listWillInvalidRedPacket(@Param(value = "userId") int userId);


  RedPacketOwner findRedPacketOwner(@Param(value = "userID") int userId,
      @Param(value = "redPacketStatus") short redPacketStatus,
      @Param(value = "lastOwnerId") int lastOwnerId);

  	List<PerRedPacketVo> showRedPacketList(@Param("userId")Long userId, @Param("type") int type);

  	int updateRedPacketOwnerUseTime(RedPacketOwner redPacketOwner);

}

